namespace hjc {

	export class Scanner extends hjc.Component {

		private static DEFAULT_SPAN: number = 200;
		private $interest: new (id?: any) => Entity;
		private $span: number;
		public get span(): number { return this.$span; }
		public set span(span: number) { this.$span = span; }
		public get interest(): new (id?: any) => Entity { return this.$interest; }
		public set interest(clazz: new (id?: any) => Entity) { this.$interest = clazz; }

		public init(clazz?: new (id?: any) => Entity, span?: number): void {
			this.$interest = Entity;
			this.$span = Scanner.DEFAULT_SPAN;
			this.$delta = utils.secondToFrame(1);
			super.resetPfc();
			if (!!clazz) this.interest = clazz;
			if (numeric(span)) this.span = span;
		}
	}
}

/**
 * 实体可监听方法：
 * onFound(entities);
 * 实体可提供方法：
 * onPrepared():boolean;
 */